<%--
  Created by IntelliJ IDEA.
  User: jimmyhsu
  Date: 2016/12/10
  Time: 14:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>导入课程</title>
    <link rel="stylesheet" href="../../static/style/weui.css"/>
    <link rel="stylesheet" href="../../static/example/example.css"/>
    <link rel="stylesheet" href="../../static/style/myStyle.css"/>
</head>
<body style="background: transparent;color: #FFFFFF;">
<%@include file="Do/checkAdminLogin.jsp"%>
<br><br><br>
<h1 class = "page_title">导入课程</h1>
<p class="page_desc">
    <a href="existedCourses.jsp">点击查看已存在的课程</a>
    <br>带(*)的是必填项
</p>
<center>
<form class="my-hero-unit" action = "Do/doImportCourse.jsp" method = "POST" name = "form" id = "form">
    <div class="weui_cells weui_cells_form" style="width: 80%;">
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">课程名称(*)</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="blue_input" type="text" name = "courseName"  placeholder="请输入课程名称"/>
            </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">学分(*)</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="blue_input" type="number" name = "credit" pattern = "[0-9]*" placeholder="请输入课程学分，不填则默认为0"/>
            </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">上课时间(*)</label></div>
            <div class="weui_cell_bd weui_cell_primary" style="text-align: left;color: black;">
                <select id="year" name="year">
                    <option value="2016">2016</option>
                    <option value="2017">2017</option>
                </select>年
                <select id="month" name="month">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                </select>月
                <select id="day" name="day">
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                    <option value="23">23</option>
                    <option value="24">24</option>
                    <option value="25">25</option>
                    <option value="26">26</option>
                    <option value="27">27</option>
                    <option value="28">28</option>
                    <option value="29">29</option>
                    <option value="30">30</option>
                    <option value="31">31</option>
                </select>日&nbsp;&nbsp;
                <select id="hour" name="hour">
                    <option value="0">0</option>
                    <option value="1">1</option>
                    <option value="2">2</option>
                    <option value="3">3</option>
                    <option value="4">4</option>
                    <option value="5">5</option>
                    <option value="6">6</option>
                    <option value="7">7</option>
                    <option value="8">8</option>
                    <option value="9">9</option>
                    <option value="10">10</option>
                    <option value="11">11</option>
                    <option value="12">12</option>
                    <option value="13">13</option>
                    <option value="14">14</option>
                    <option value="15">15</option>
                    <option value="16">16</option>
                    <option value="17">17</option>
                    <option value="18">18</option>
                    <option value="19">19</option>
                    <option value="20">20</option>
                    <option value="21">21</option>
                    <option value="22">22</option>
                    <option value="23">23</option>
                </select>时
                <select id="minute" name="minute">
                    <option value="0">00</option>
                    <option value="5">05</option>
                    <option value="10">10</option>
                    <option value="15">15</option>
                    <option value="20">20</option>
                    <option value="25">25</option>
                    <option value="30">30</option>
                    <option value="35">35</option>
                    <option value="40">40</option>
                    <option value="45">45</option>
                    <option value="50">50</option>
                    <option value="55">55</option>
                </select>分
            </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">上课地点(*)</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="blue_input" type="text" name = "location" placeholder="请输入上课地点"/>
            </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">持续时间(分)</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="blue_input" type="number" name = "duration" pattern = "[0-9]*" placeholder="请输入课程时间"/>
            </div>
        </div>
        <div class="weui_cell">
            <div class="weui_cell_hd"><label class="weui_label">最大人数</label></div>
            <div class="weui_cell_bd weui_cell_primary">
                <input class="blue_input" type="number" name = "maxNumber" pattern = "[0-9]*" placeholder="请输入课程最大人数"/>
            </div>
        </div>
    </div>
</form>
</center>
<br>
<center>
<button class="green_btn" style = "position: relative" onclick="mySubmit()">完成</button>
</center>
<script type="text/javascript">
    function mySubmit()
    {

        if(document.getElementsByName("courseName")[0].value == "" ||
            document.getElementsByName("year")[0].value == "" ||
            document.getElementsByName("month")[0].value == "" ||
            document.getElementsByName("day")[0].value == "" ||
            document.getElementsByName("hour")[0].value == "" ||
            document.getElementsByName("minute")[0].value == "" ||
            document.getElementsByName("location")[0].value == "")
        {
            alert("课程名称、上课时间、上课地点不能为空！");
            return;
        }
        document.form.submit();
    }
</script>
</body>
</html>
